WOLF core
WOLF: A Modular Estimation Framework for Robotics
XXXXXXXXXXXXXXXXXXXXXXXXvoid(0)" frameborder="0" name="MSearchResults" id="MSearchResults">
wolf::ProcessorLoopClosure Class Referenceabstract

General loop closure processor. More...

#include <core/processor/processor_loop_closure.h>

Inheritance diagram for wolf::ProcessorLoopClosure:
[legend]

Public Member Functions

 ProcessorLoopClosure (const std::string &_type, const TypeComposite &_state_types, const YAML::Node &_params)
 Constructor from the derived class name, the state types and the YAML parameters. More...
 
 ~ProcessorLoopClosure () override=default
 
void configure (SensorBasePtr _sensor) override
 Configures the processor once linked to its sensor. More...
 
int getMaxLoops () const
 Returns the maximum number of loops closed in each keyframe callback (negative: unlimited) More...
 
void setMaxLoops (int _max_loops)
 Sets the maximum number of loops closed in each keyframe callback (negative: unlimited) More...
 
- Public Member Functions inherited from wolf::ProcessorBase
void startCaptureProfiling ()
 Starts the profiling of a capture processing. More...
 
void stopCaptureProfiling ()
 Stops the profiling of a capture processing. More...
 
void startKFProfiling ()
 Starts the profiling of a keyframe processing. More...
 
void stopKFProfiling ()
 Stops the profiling of a keyframe processing. More...
 
virtual void printProfiling (std::ostream &stream=std::cout) const
 Prints the profiling of the capture and keyframe processing. More...
 
 ProcessorBase (const std::string &_type, const TypeComposite &_state_types, const YAML::Node &_params)
 Constructor. More...
 
 ~ProcessorBase () override
 
virtual void configure (SensorBasePtr _sensor)=0
 Configures the processor once linked to its sensor. More...
 
virtual void remove ()
 Removes the processor from its sensor (and from the motion providers of the problem) More...
 
bool hasChildren () const override
 Returns whether the node has children in the Wolf tree. More...
 
const TypeComposite & getStateTypes () const
 Returns the state types of the frames created or used by this processor. More...
 
StateKeys getStateKeys () const
 Returns the state keys of the frames created or used by this processor. More...
 
unsigned int id () const
 Returns the processor id. More...
 
void keyFrameCallback (FrameBasePtr _keyframe)
 Notifies a new keyframe (created by another processor) More...
 
void captureCallback (CaptureBasePtr _capture)
 Notifies a new capture. More...
 
SensorBaseConstPtr getSensor () const
 Returns the sensor the processor belongs to. More...
 
SensorBasePtr getSensor ()
 Returns the sensor the processor belongs to. More...
 
YAML::Node getParams () const
 Returns a copy of the YAML parameters. More...
 
bool isMotionProvider () const
 Returns whether the processor is a MotionProvider. More...
 
bool applyLossFunction () const
 Returns whether the factors created by the processor apply a loss function. More...
 
bool isVotingActive () const
 Returns whether the processor can vote for keyframes. More...
 
double getTimeTolerance () const
 Returns the time tolerance to associate time stamps. More...
 
void setApplyLossFunction (bool _apply_loss_function)
 Sets whether the factors created by the processor apply a loss function. More...
 
void setVotingActive (bool _voting_active)
 Sets whether the processor can vote for keyframes. More...
 
void setTimeTolerance (double _time_tolerance)
 Sets the time tolerance to associate time stamps. More...
 
void setDebugVerboseLevel (const std::string &_debug_verbose_level)
 Sets the debug verbosity level: "none", "derived", "base" or "all". More...
 
std::string getDebugVerboseLevel () const
 Returns the debug verbosity level. More...
 
bool checkTimeTolerance (const TimeStamp &_ts1, const TimeStamp &_ts2) const
 Returns whether two time stamps are within the time tolerance. More...
 
bool checkTimeTolerance (const CaptureBasePtr _cap, const TimeStamp &_ts) const
 Returns whether the capture and a time stamp are within the time tolerance. More...
 
bool checkTimeTolerance (const FrameBasePtr _frm, const TimeStamp &_ts) const
 Returns whether the frame and a time stamp are within the time tolerance. More...
 
bool checkTimeTolerance (const FrameBasePtr _frm, const CaptureBasePtr _cap) const
 Returns whether the frame and the capture are within the time tolerance. More...
 
virtual void link (SensorBasePtr) final
 Links the processor to a sensor. More...
 
virtual void printHeader (int depth, bool factored_by, bool metric, bool state_blocks, std::ostream &stream, std::string _tabs="") const
 Prints the information of this node (not of its children) More...
 
void print (int depth, bool factored_by, bool metric, bool state_blocks, std::ostream &stream=std::cout, std::string _tabs="") const
 Prints this node and, depending on the depth, its children. More...
 
virtual CheckLog localCheck (bool _verbose, std::ostream &_stream, std::string _tabs="") const
 Checks the consistency of this node (not of its children) More...
 
bool check (CheckLog &_log, bool _verbose, std::ostream &_stream, std::string _tabs="") const
 Checks the consistency of this node and its children, composing the log. More...
 
- Public Member Functions inherited from wolf::NodeBase
 NodeBase (const std::string &_category, const std::string &_type="Undefined", const std::string &_name="")
 Constructor. More...
 
virtual ~NodeBase ()=default
 Destructor. More...
 
unsigned int nodeId () const
 Returns the node id, unique over the whole Wolf tree. More...
 
std::string getCategory () const
 Returns the category of the node. More...
 
std::string getType () const
 Returns the type (subcategory) of the node. More...
 
std::string getName () const
 Returns the name of the node. More...
 
bool isRemoving () const
 Returns whether the node is being removed. More...
 
virtual bool hasChildren () const =0
 Returns whether the node has children in the Wolf tree. More...
 
void setType (const std::string &_type)
 Sets the type (subcategory) of the node. More...
 
void setName (const std::string &_name)
 Sets the name of the node. More...
 
ProblemConstPtr getProblem () const
 Returns the problem the node belongs to. More...
 
ProblemPtr getProblem ()
 Returns the problem the node belongs to. More...
 

Protected Member Functions

virtual void process (CaptureBasePtr)
 Processes a capture (linked to a frame) More...
 
virtual bool voteFindLoopClosures (CaptureBasePtr cap)=0
 Returns whether findLoopClosures() has to be called for the given capture. More...
 
virtual void emplaceFeatures (CaptureBasePtr cap)=0
 Detects and emplaces all features of the given capture. More...
 
virtual std::map< double, MatchLoopClosurePtr > findLoopClosures (CaptureBasePtr _capture)=0
 Finds captures that correspond to loop closures with the given capture. More...
 
virtual bool validateLoopClosure (MatchLoopClosurePtr)=0
 Returns whether a loop closure is valid. More...
 
virtual void emplaceFactors (MatchLoopClosurePtr)=0
 Emplaces the factor(s) corresponding to a loop closure between two captures. More...
 
void processCapture (CaptureBasePtr) override
 Processes an incoming capture. More...
 
void processKeyFrame (FrameBasePtr _frm) override
 Processes an incoming keyframe. More...
 
bool triggerInCapture (CaptureBasePtr _cap) const override
 Returns whether processCapture() should be called after the provided capture arrived. More...
 
bool triggerInKeyFrame (FrameBasePtr _frm) const override
 Returns whether processKeyFrame() should be called after the provided keyframe arrived. More...
 
bool storeKeyFrame (FrameBasePtr _frm) override
 Returns whether the provided keyframe should be stored in buffer_frame_. More...
 
bool storeCapture (CaptureBasePtr _cap) override
 Returns whether the provided capture should be stored in buffer_capture_. More...
 
bool voteForKeyFrame () const override
 Votes for keyframe generation. More...
 
- Protected Member Functions inherited from wolf::ProcessorBase
virtual void processCapture (CaptureBasePtr)=0
 Processes an incoming capture. More...
 
virtual void processKeyFrame (FrameBasePtr _keyframe_ptr)=0
 Processes an incoming keyframe. More...
 
virtual bool triggerInCapture (CaptureBasePtr) const =0
 Returns whether processCapture() should be called after the provided capture arrived. More...
 
virtual bool triggerInKeyFrame (FrameBasePtr) const =0
 Returns whether processKeyFrame() should be called after the provided keyframe arrived. More...
 
virtual bool storeKeyFrame (FrameBasePtr)=0
 Returns whether the provided keyframe should be stored in buffer_frame_. More...
 
virtual bool storeCapture (CaptureBasePtr)=0
 Returns whether the provided capture should be stored in buffer_capture_. More...
 
virtual bool voteForKeyFrame () const =0
 Votes for keyframe generation. More...
 
virtual bool permittedKeyFrame () const final
 Returns whether this processor can create a keyframe: voting is active and the problem permits it. More...
 
void setProblem (ProblemPtr) override
 Sets the problem, adding the state types to it and, if it is a state provider, the processor as motion provider. More...
 
void addTypes (const TypeComposite &)
 Adds the provided state types to the processor and to the problem (if set). Throws if a key already has a different type. More...
 
virtual void setProblem (ProblemPtr _prob_ptr)
 Sets the problem the node belongs to. More...
 

Additional Inherited Members

- Protected Attributes inherited from wolf::ProcessorBase
unsigned int processor_id_
 Processor id, unique among processors. More...
 
YAML::Node params_
 YAML parameters. More...
 
BufferFrame buffer_frame_
 Buffer of the received keyframes to be processed. More...
 
BufferCapture buffer_capture_
 Buffer of the received captures to be processed. More...
 
std::string debug_verbose_level_
 Debug verbosity level: "none", "derived", "base" or "all". More...
 
- Protected Attributes inherited from wolf::NodeBase
ProblemWPtr problem_ptr_
 Problem the node belongs to. More...
 
unsigned int node_id_
 Node id. It is unique over the whole Wolf Tree. More...
 
std::string node_category_
 Text label identifying the category of node ("SENSOR", "FEATURE", etc) More...
 
std::string node_type_
 Type or subcategory of node (derived class name: "SensorOdom2d", etc) More...
 
std::string node_name_
 
bool is_removing_
 A flag for safely removing nodes from the Wolf tree. See remove(). More...
 

Detailed Description

General loop closure processor.

This is an abstract class.

Constructor & Destructor Documentation

◆ ProcessorLoopClosure()

wolf::ProcessorLoopClosure::ProcessorLoopClosure ( const std::string &  _type,
const TypeComposite &  _state_types,
const YAML::Node &  _params 
)

Constructor from the derived class name, the state types and the YAML parameters.

◆ ~ProcessorLoopClosure()

wolf::ProcessorLoopClosure::~ProcessorLoopClosure ( )
overridedefault

Member Function Documentation

◆ configure()

void wolf::ProcessorLoopClosure::configure ( SensorBasePtr  _sensor)
inlineoverridevirtual

Configures the processor once linked to its sensor.

Implements wolf::ProcessorBase.

◆ emplaceFactors()

virtual void wolf::ProcessorLoopClosure::emplaceFactors ( MatchLoopClosurePtr  )
protectedpure virtual

Emplaces the factor(s) corresponding to a loop closure between two captures.

◆ emplaceFeatures()

virtual void wolf::ProcessorLoopClosure::emplaceFeatures ( CaptureBasePtr  cap)
protectedpure virtual

Detects and emplaces all features of the given capture.

◆ findLoopClosures()

virtual std::map< double, MatchLoopClosurePtr > wolf::ProcessorLoopClosure::findLoopClosures ( CaptureBasePtr  _capture)
protectedpure virtual

Finds captures that correspond to loop closures with the given capture.

Returns the loop closures indexed by their normalized score (MatchLoopClosure::normalized_score, 0 is bad, 1 is good), so the keys have to be unique.

◆ getMaxLoops()

int wolf::ProcessorLoopClosure::getMaxLoops ( ) const
inline

Returns the maximum number of loops closed in each keyframe callback (negative: unlimited)

◆ process()

void wolf::ProcessorLoopClosure::process ( CaptureBasePtr  _capture)
protectedvirtual

Processes a capture (linked to a frame)

It emplaces the features of the capture (emplaceFeatures()). If voteFindLoopClosures() returns true, findLoopClosures() is called, and emplaceFactors() is called for each loop closure validated by validateLoopClosure(), from the best normalized score to the worst, up to the maximum number of loops.

◆ processCapture()

void wolf::ProcessorLoopClosure::processCapture ( CaptureBasePtr  )
overrideprotectedvirtual

Processes an incoming capture.

Each derived processor should implement this function. It will be called if:

Implements wolf::ProcessorBase.

◆ processKeyFrame()

void wolf::ProcessorLoopClosure::processKeyFrame ( FrameBasePtr  _keyframe_ptr)
overrideprotectedvirtual

Processes an incoming keyframe.

Each derived processor should implement this function. It will be called if:

Implements wolf::ProcessorBase.

◆ setMaxLoops()

void wolf::ProcessorLoopClosure::setMaxLoops ( int  _max_loops)
inline

Sets the maximum number of loops closed in each keyframe callback (negative: unlimited)

◆ storeCapture()

bool wolf::ProcessorLoopClosure::storeCapture ( CaptureBasePtr  )
inlineoverrideprotectedvirtual

Returns whether the provided capture should be stored in buffer_capture_.

Implements wolf::ProcessorBase.

◆ storeKeyFrame()

bool wolf::ProcessorLoopClosure::storeKeyFrame ( FrameBasePtr  )
inlineoverrideprotectedvirtual

Returns whether the provided keyframe should be stored in buffer_frame_.

Implements wolf::ProcessorBase.

◆ triggerInCapture()

bool wolf::ProcessorLoopClosure::triggerInCapture ( CaptureBasePtr  ) const
inlineoverrideprotectedvirtual

Returns whether processCapture() should be called after the provided capture arrived.

Implements wolf::ProcessorBase.

◆ triggerInKeyFrame()

bool wolf::ProcessorLoopClosure::triggerInKeyFrame ( FrameBasePtr  ) const
inlineoverrideprotectedvirtual

Returns whether processKeyFrame() should be called after the provided keyframe arrived.

Implements wolf::ProcessorBase.

◆ validateLoopClosure()

virtual bool wolf::ProcessorLoopClosure::validateLoopClosure ( MatchLoopClosurePtr  )
protectedpure virtual

Returns whether a loop closure is valid.

◆ voteFindLoopClosures()

virtual bool wolf::ProcessorLoopClosure::voteFindLoopClosures ( CaptureBasePtr  cap)
protectedpure virtual

Returns whether findLoopClosures() has to be called for the given capture.

◆ voteForKeyFrame()

bool wolf::ProcessorLoopClosure::voteForKeyFrame ( ) const
inlineoverrideprotectedvirtual

Votes for keyframe generation.

If a KeyFrame criterion is validated, this function returns true, meaning that it wants to create a KeyFrame at the last Capture.

WARNING! This function only votes! It does not create KeyFrames!

Implements wolf::ProcessorBase.


The documentation for this class was generated from the following files: